package org.example.custom.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.baomidou.entity.OrderMain;
import org.example.custom.annotation.MyDS;
import org.example.custom.mapper.OrderMapper;
import org.example.custom.service.OrderService;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderMain> implements OrderService {

    //读写order库
    @MyDS("order")
    @Override
    public int saveOrder() {
        OrderMain orderMain = new OrderMain();
        long currentTimeMillis = System.currentTimeMillis();
        orderMain.setOrderNo("PO" + currentTimeMillis);
        orderMain.setOrderName("订单" + currentTimeMillis);
        save(orderMain);
        return 1;
    }
}
